package com.bolt.support.spring.jpa.jpql;

import com.bolt.support.query.conditions.domain.SqlClause;

import java.lang.reflect.Field;
import java.util.List;
import java.util.Properties;

/**
 * Created by Administrator on 2020/9/7.
 */
public interface QueryMetadata {
    void setReturnClass(Class <?> clazz);

    void addSelect(SqlClause<?>... column);

    void addFrom(EntityClause... args);

    void setWhere(OperationClause where);

    void addJoin(JoinType joinType, EntityClause expr);

    void addJoinCondition(OperationClause clause);

    void addUpdates(SqlClause <?> ... paramClause);

    List<JoinClause> getJoins();


    void addGroupBy(SqlClause <?>... column);

    void addHaving(OperationClause clause);

    void addOrderBy(SqlClause <?>... clause);

    List <SqlClause <?>> getGroupBy();

    List <SqlClause <?>> getSelect();

    OperationClause getWhere();

    OperationClause getHaving();

    List <SqlClause <?>> getOrderBy();

    Class <?> getReturnClass();

    Properties getParam();

    void setLimit(Long limit);

    void setOffset(Long offset);

    Integer getLimit();

    Integer getOffset();

    boolean isDistinct();

    void setDistinct(boolean distinct);

    List<SqlClause <?>> getUpdates();

    void addDynamicConditions(DynamicCondition dynamicCondition);

    List <DynamicCondition> getDynamicConditions();

    void addResultProcessor(Object resultPro);

    List<Object> getResultProcessor();

    List<Field> getAccessFields();

    List<String> getAliases();

    boolean isAllField();

    void setAllField(boolean allField);
    //用于关联表查询
    void setSubCount(boolean used);

    boolean isSubCount();

    boolean nativeQuery();

    void setNativeQuery(boolean create);

    HqlTranslator nativeTranslator();
}
